package pe.intix.drawback.model

import javax.persistence.*;

import org.openxava.annotations.*;

/**
 * @author Jeromy Altuna
 */
@Entity
@Views([
	@View(extendsView = "super.DEFAULT", members = """;
			proveedor;
			Montos [# 
				tipoMoneda, valorVenta, importeTotal
			];
			detalleComprobantePago;
			glosa"""
	),
	@View(name = "SerieNumeroFecha", members = "serie, numero, fecha")	
])
@Tab(properties="serie, numero, fecha, proveedor.razonSocial, glosa, hayImagen")
@DiscriminatorValue("1")
class ComprobanteCompra extends ComprobantePago {

	@Required
	@JoinColumn(name = "id_proveedor", referencedColumnName="id_proveedor")
	@ManyToOne(fetch=FetchType.LAZY, optional=false)
	Proveedor proveedor
}
